repo: Only open regular files
authorColin Walters <walters@verbum.org>
Wed, 19 Oct 2011 22:06:06 +0000 (18:06 -0400)
committerColin Walters <walters@verbum.org>
Wed, 19 Oct 2011 22:06:06 +0000 (18:06 -0400)
Otherwise we'll try to open device files with predictably bad
consequences.

src/libostree/ostree-core.c
src/libostree/ostree-repo.c

index ccf35dd6d1d3e83d3f215b0eeb58a4933b8fca4d..fb6ad1b2b689385312e15b4c4f2851d154f65bb9 100644 (file)
@@ -193,7 +193,7 @@ ostree_stat_and_checksum_file (int dir_fd, const char *path,
       goto out;
     }
 
-  if (!S_ISLNK(stbuf.st_mode))
+  if (S_ISREG(stbuf.st_mode))
     {
       fd = ot_util_open_file_read_at (dir_fd, basename, error);
       if (fd < 0)
index 0dfe67d30c6859f71c823b2fd493ab7570a8e9be..096953b7cdca7c4a1410d85665474f37e882c4ee 100644 (file)
@@ -1096,7 +1096,7 @@ add_one_file_to_tree_and_import (OstreeRepo   *self,
 }
 
 static gboolean
-add_one_path_to_tree_and_import (OstreeRepo   *self,
+add_one_path_to_tree_and_import (OstreeRepo     *self,
                                  const char     *base,
                                  const char     *filename,
                                  ParsedTreeData *tree,